unit uAtolConstants;

interface

const
  A_LEFT = 0;
  A_CENTER = 1;
  A_RIGHT = 2;
  //---------------------------------------------------------------------
  PP_CHECK = 1;
  PP_KASS = 2;
  PP_BOTH = 3;
  //---------------------------------------------------------------------
  FT_INT = 0;
  FT_STRING = 1;
  FT_ARRAY = 2;
  //---------------------------------------------------------------------
  EXCEPTION_RESULT_CODE = -9999;

function Int2AtolBaud(const AIntBaud: Integer): Integer;
function Atol2IntBaud(const AAtolBaud: Integer): Integer;

implementation

function Int2AtolBaud(const AIntBaud: Integer): Integer;
begin
  case AIntBaud of
    1200: Result := 3;
    2400: Result := 4;
    4800: Result := 5;
    9600: Result := 7;
    14400: Result := 9;
    19200: Result := 10;
    38400: Result := 12;
    57600: Result := 14;
    115200: Result := 18;
  else
    Result := 115200;
  end;
end;

function Atol2IntBaud(const AAtolBaud: Integer): Integer;
begin
  case AAtolBaud of
    3: Result := 1200;
    4: Result := 2400;
    5: Result := 4800;
    7: Result := 9600;
    9: Result := 14400;
    10: Result := 19200;
    12: Result := 38400;
    14: Result := 57600;
    18: Result := 115200;
  else
    Result := 18;
  end;
end;

end.

